package resources;

import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Beans {
	private static Beans instance;
	private String path="resources/applicationContext.xml";
	private  AbstractApplicationContext Beans;

	public synchronized static Beans getInstance() {
		if (instance == null) {
			instance = new Beans();
		}
		return instance;
	}
	private Beans() {
		this.Beans = new ClassPathXmlApplicationContext(path);
	}
	public AbstractApplicationContext getBeans() {
		return Beans;
	}
	public Object getBean(String name){
		return this.Beans.getBean(name);
	}
	
}
